<?php

namespace app\controller\index;

use app\result\admin\NoticeResult;
use app\result\UserMsgResult;
use think\App;

class Msg extends BaseIndex
{

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->objResult = new UserMsgResult();
    }

    //消息列表
    public function list()
    {
        data_exit_json($this->objResult->list($this->user_id, $this->param));
    }

    public function read_all()
    {
        data_exit_json($this->objResult->read_all($this->user_id));
    }

    //公告
    public function notice_list()
    {
        data_exit_json((new NoticeResult())->list_for_api($this->param));
    }

    //详情
    public function get()
    {
        data_exit_json($this->objResult->get($this->user_id, $this->param));
    }
}
